﻿using System.Collections.Generic;
using System.Linq;
using JStore.Core.Entities;
using SpeadFrm.ORM;

namespace JStore.Data.Daos
{
    /// <summary>
    ///
    /// </summary>
    public class UserTypeJdRateConfigDao : BaseDao<UserTypeJdRateConfig>
    {
        public void DeleteById(int id)
        {
            var sql = Sql.Builder.Where("Id = @0", id);
            Delete(sql);
        }

        public List<UserTypeJdRateConfig> GetListByUserTypeId(int userTypeId)
        {
            var sql = Sql.Builder.Where("UserTypeId = @0", userTypeId);
            return Query(sql).ToList();
        }

        public List<UserTypeJdRateConfig> GetAll()
        {
            var sql = Sql.Builder.Where("1=1");
            return Query(sql).ToList();
        }
    }
}

